import qs from 'qs'
import axios from 'axios'
var axiosPost = function(restfulType,postData){
    console.log(postData)
    var restFulData={
        _get:{
            method:'get',
            url:'https://leancloud.cn:443/1.1/classes/Category?'+qs.stringify(postData),
            data:function(){
                return ''
            },
            transformResponse:function(res){
            	console.log(res)
                if(res.code===undefined){
                	return res
                }else{
                    return false
                }

            }
        }
    }
    var restFulUse=restFulData['_'+restfulType];
    return axios({
        url:restFulUse.url,
        method:restFulUse.method,
        responseType:'json',
        data:restFulUse.data(),
        transformResponse:[function(res){
            return restFulUse.transformResponse(res);
        }]
    });
}
export default axiosPost;
